export const checkPhone = (rule: any, value: any, callback: any) => {
  const reg = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;

  if (value === '') {
    callback(new Error('请输入联系电话'))
  } else if (!reg.test(value)) {
    callback(new Error('请检查手机号格式'))
  } else {
    callback();
  }
};

export const checkPwd = (rule: any, value: any, callback: any) => {
  const reg = /^(?![A-Za-z]+$)(?![A-Z\d]+$)(?![A-Z\W]+$)(?![a-z\d]+$)(?![a-z\W]+$)(?![\d\W]+$)\S{8,20}$/;

  if (!reg.test(value)) {
      callback(new Error('请检查密码格式'))
  } else {
    callback();
  }
};